<template>
  <view class="feedback-page">
    <!-- 页面标题 -->
    <view class="page-title">意见反馈</view>

    <!-- 反馈表单 -->
    <view class="feedback-form">
      <textarea
        v-model="feedbackContent"
        placeholder="请输入您的意见或建议"
        class="feedback-input"
        maxlength="500"
      ></textarea>
      <view class="word-count">{{ feedbackContent.length }}/500</view>
    </view>

    <!-- 提交按钮 -->
    <view class="submit-button" @click="handleSubmit">
      <text>提交反馈</text>
    </view>
  </view>
</template>

<script setup>
import { ref } from 'vue';

// 反馈内容
const feedbackContent = ref('');

// 处理提交反馈
const handleSubmit = () => {
  if (!feedbackContent.value.trim()) {
    uni.showToast({
      title: '请输入反馈内容',
      icon: 'none',
    });
    return;
  }

  uni.showToast({
    title: '提交成功',
    icon: 'success',
  });

  // 清空反馈内容
  feedbackContent.value = '';
};
</script>

<style scoped>
.feedback-page {
  padding: 20px;
  background-color: #f8f8f8;
  min-height: 100vh;
}

.page-title {
  font-size: 24px;
  font-weight: bold;
  color: #333;
  margin-bottom: 20px;
}

.feedback-form {
  background-color: #fff;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.feedback-input {
  width: 100%;
  height: 200px;
  font-size: 16px;
  color: #333;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 10px;
}

.word-count {
  font-size: 14px;
  color: #999;
  text-align: right;
}

.submit-button {
  margin-top: 30px;
  background-color: #409eff;
  color: #fff;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(64, 158, 255, 0.3);
}

.submit-button:active {
  background-color: #66b1ff;
}
</style>